import request from '../utils/request'
// 定义可能的数据类型
export type RegisterData ={
    nickName: string|null,
    phonenumber: string|null,
    userName: string|null|'',
    password: string|null,
};
export type LoginData ={
    // userName: string|null|'',
    // password: string|null,
    // code: string|null,
    // uuid: string|null,

    userName: string,
    password: string,
    code: string,
    uuid: string,
};

export function login(data: LoginData) {
    return request({
        url: '/login',
        headers: {
            isToken: false,
            repeatSubmit: false
        },
        method: 'post',
        data: data
    })
}

export function register(data: RegisterData) {
    return request({
        url: '/register',
        method: 'post',
        data: data
    })
}

// 退出方法
export function logout() {
    return request({
        url: '/logout',
        method: 'post'
    })
}
